<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>cute-transfer: E:/CODE/CPPpro/cute-transfer/Msg&amp;FileTransfer/glue.h源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">cute-transfer</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">E:/CODE/CPPpro/cute-transfer/Msg&amp;FileTransfer/glue.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00015"></a>00015 <span class="preprocessor">#ifndef GULE_H_INCLUDED</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define GULE_H_INCLUDED</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;winsock2.h&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;ConFile.h&quot;</span>
<a name="l00021"></a>00021 
<a name="l00022"></a><a class="code" href="struct____addr.html">00022</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct____addr.html">__addr</a>
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024     <span class="keywordtype">char</span> ip[16];
<a name="l00025"></a>00025     <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> port;
<a name="l00026"></a>00026     <span class="keywordtype">bool</span> operator &lt;(<span class="keyword">const</span> <a class="code" href="struct____addr.html">__addr</a>&amp; t)<span class="keyword"> const</span>
<a name="l00027"></a>00027 <span class="keyword">    </span>{
<a name="l00028"></a>00028         <span class="keywordflow">if</span> (port &lt; t.port)
<a name="l00029"></a>00029         {
<a name="l00030"></a>00030             <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00031"></a>00031         }
<a name="l00032"></a>00032         <span class="keywordflow">else</span>
<a name="l00033"></a>00033         {
<a name="l00034"></a>00034             <span class="keywordflow">if</span> (strncmp(ip, t.ip, 16) &lt; 0)
<a name="l00035"></a>00035             {
<a name="l00036"></a>00036                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00037"></a>00037             }
<a name="l00038"></a>00038         }
<a name="l00039"></a>00039         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00040"></a>00040     }
<a name="l00041"></a>00041 } <a class="code" href="struct____addr.html">addr</a>;
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 <span class="keywordtype">int</span> recv_message(SOCKADDR_IN&amp; sa_in, <span class="keyword">const</span> <span class="keywordtype">char</span>* mes);
<a name="l00044"></a>00044 <span class="keywordtype">int</span> send_message(<span class="keyword">const</span> <span class="keywordtype">char</span>* ip, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> port, <span class="keyword">const</span> std::string&amp; mes);
<a name="l00045"></a>00045 <span class="keywordtype">int</span> recv_file_request();
<a name="l00046"></a>00046 <span class="keywordtype">int</span> recv_file_init(SOCKADDR_IN&amp; sa_in, <a class="code" href="struct_____file_info.html" title="文件状态结构体">FileInfo</a>&amp; finfo);
<a name="l00047"></a>00047 <span class="keywordtype">int</span> recv_file(<span class="keyword">const</span> std::string&amp; filepath, <span class="keywordtype">int</span> progress);
<a name="l00048"></a>00048 <span class="keywordtype">int</span> send_file(<span class="keyword">const</span> std::string&amp; filepath, <span class="keywordtype">int</span> progress);
<a name="l00049"></a>00049 <span class="keywordtype">int</span> send_file_init(SOCKADDR_IN &amp;sa_in, <span class="keyword">const</span> std::string &amp;filepath, <a class="code" href="struct_____file_info.html" title="文件状态结构体">FileInfo</a>&amp; finfo);
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="preprocessor">#endif // GULE_H_INCLUDED</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>类型定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>枚举</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>枚举值</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at 2011年七月8日 星期五 15:50:01 for cute-transfer by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>
